package com.weixing.mall.provider.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.weixing.mall.provider.model.domain.Menu;
import com.weixing.mall.provider.model.domain.Role;
import com.weixing.mall.provider.model.domain.RoleUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 角色用户关联表 Mapper 接口
 * </p>
 *
 * @author Small
 * @since 2019-11-18
 */
public interface RoleUserMapper extends BaseMapper<RoleUser> {

    void deleteByUserId(Long id);

    List<RoleUser> selectByUserId(long id);

    List<Menu> selectUserMenus(@Param("userId") Long userId, @Param("sysFlag") Integer sysFlag);

    List<String> selectUserMenu(Long userId);

    List<RoleUser> selectByRoleId(long id);

    List<Role> findByUserId(Long id);

    List<Menu> selectUserMenusByRoleCode(@Param("roleCode") String roleCode, @Param("sysFlag") Integer sysFlag);
}
